package cn.varton;

public class IpBelong implements IBelong{
    @Override
    public void queryBelong(String param) {
        if(param.matches("^(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\.(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)$")){
            System.out.println("查询ip："+param+",归属地为：广东广州");
        }else {
            System.out.println("参数不合法！"+param);
        }
    }
}
